<html>
<head>
<style>
.not_submited{
	color:red;
}
</style>
	<script type="text/javascript">
		var aJaxURL			= "server-side/operations/pos_check.action.php";		//server side folder url
		var tName			= "example";													//table name
		var fName			= "add-edit-form";												//form name
		
		$(document).ready(function () {
            
			LoadTable();
						
			/* Add Button ID, Delete Button ID */
			GetButtons("add_button", "");
			
			SetEvents("add_button", "", "", tName, fName, aJaxURL);
		});
		

        
		function LoadTable(){
                GetDataTable(tName, aJaxURL, "get_list", 13, "", 0, "", 0, "desc");
		}

		function LoadDialog(){		
			/* Dialog Form Selector Name, Buttons Array */
			var buttons = {
			        "submit": {
			            text: "დადასტურება",
			            id: "submit_button",
			            icons: {
			                primary: "ui-icon-circle-check"
			            },
			            click: function () {
			            }
			        },	
					"close": {
						text: "დახურვა",
						id: "close",
						click: function() {
							 $(this).dialog("close");
						}
					}
				};
		        	
			GetDialog(fName, 761, "auto", buttons, "");		
	
		}

		 $(document).on("click", "#submit_button", function () {
				param = new Object();
				
				param.act		= 'submit_check';
				param.check_id  = $("#check_id").val();
				param.comment   = $("#manager_comment").val();

				$.ajax({
					url: aJaxURL,
					data: param,
					success: function(data) {
						if (typeof (data.error) != "undefined") {
	                        if (data.error != "") {
	                            alert(data.error);
	                        } else {
	                        	 $("#add-edit-form").dialog("close");
	                        	 LoadTable();
	                        }
	                    }
					}
				});
				
		 });

    </script>
</head>

<body>
    <div id="dt_example" class="ex_highlight_row">
        <div id="container" style="width:98%">
            <div id="dynamic">
            	<h2 align="center">სალაროს გასწორება</h2>
<!--             	<div id="button_area"> -->
<!--         			<button id="add_button">იყოს მაინც</button> -->
<!--         		</div> -->
                <table class="display" id="example">
                    <thead>
                        <tr id="datatable_header">
                            <th>ID</th>
                            <th style="width:150px">თარიღი</th>
                            <th style="width:150px">ობიექტი</th>
                            <th style="width:150px">ჩააბარა</th>
                            <th style="width:150px">ჩაიბარა</th>        
                            <th style="width:100px">თანხა</th>
                            <th style="width:80px">რეალ. <br> თანხა</th>
                            <th style="width:80px">სხვაობა</th>
                            <th style="width:180px">სალარო გაასწორა</th>
                            <th style="width:150px">დადასტ.თარიღი</th>
                            <th style="width:50%">მოლარის შენიშვნა</th>
                            <th style="width:50%">მენეჯერის შენიშვნა</th>
                            <th style="width:150px">სტატუსი</th>
                        </tr>
                    </thead>
                    <thead>
                        <tr class="search_header">
                            <th class="colum_hidden">
                            	<input type="text" name="search_id" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                                <input type="text" name="search_date" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                                <input type="text" name="search_objcet" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                                <input type="text" name="search_last_user" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                                <input type="text" name="search_user" value="ფილტრი" class="search_init" />
                            </th>                            
                            <th>
                                <input type="text"  name="search_money" value="ფილტრი" class="search_init" style="width:90px"/>
                            </th>    
                            <th>
                                <input type="text"  name="search_real_money" value="ფილტრი" class="search_init" style="width:70px"/>
                            </th>
                            <th>
                                <input type="text"  name="difference" value="ფილტრი" class="search_init" style="width:70px"/>
                            </th>  
                            <th>
                                <input type="text" name="search_manager" value="ფილტრი" class="search_init" style="width:170px"/>
                            </th>   
                             <th>
                                <input type="text" name="search_submit_time" value="ფილტრი" class="search_init" />
                            </th>     
                             <th>
                                <input type="text" name="search_comment" value="ფილტრი" class="search_init" style="width:250px"/>
                            </th>      
                            <th>
                                <input type="text" name="search_manager_comment" value="ფილტრი" class="search_init" style="width:250px"/>
                            </th>    
                             <th>
                                <input type="text" name="search_status" value="ფილტრი" class="search_init" />
                            </th>                     
                        </tr>
                    </thead>
                </table>
            </div>
            <div class="spacer">
            </div>
        </div>
    </div>
    
    <!-- jQuery Dialog -->
    <div id="add-edit-form" class="form-dialog" title="სალაროს გასწორება">
    	<!-- aJax -->
	</div>
</body>
</html>